import tushare as ts
import pandas as pd
from sklearn.preprocessing import MinMaxScaler
token = 'd67b0d40ccabf543ac962d2987d124588ae6fa5d2041e70fc8c93beb'
api = ts.pro_api(token)
symbol = '300750.SZ'
count = 10
prices = api.daily(ts_code=symbol, start_date='20210801', end_date='20210813')['close'].tail(count)

#用一句话返回离差标准化的实现
def minMaxNormalize(data):
    return pd.Series([x for x in MinMaxScaler().fit_transform(prices.values.reshape(-1, 1)).flatten()], index=prices.index, name='离差标准化值')
Data=minMaxNormalize(prices).rename('离差标准化值')
print(Data)
